import fastify from "fastify";

async function p1(app) {
  console.log(app.foo);
}

async function p2(app) {
  app.decorate("foo", "bar");
}
async function base(app) {
  app.register(p2);
  app.register(p1);
}
const root = fastify();

root.register(base);

root.listen({
  port: 3333,
});

console.log("running.");
